<!--
 * @Author: daidai
 * @Date: 2022-03-01 09:16:22
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-09-29 15:12:34
 * @FilePath: \web-pc\src\pages\big-screen\components\item-wrap\item-wrap.vue
-->
<template>
  <div class="lr_titles" :color="color" :backgroundColor="backgroundColor"
    :class="listid === 1 ? 'left-title' : listid === 5 ? 'right-title' : ''">
    <div class="item-title" v-if="title !== ''">
      <div class="title-inner">
        {{ title }}
      </div>
      <div class="you"></div>
    </div>
    <div :class="title !== '' ? 'item_title_content' : 'item_title_content_def'">
      <div class="more" @click="clickTitle">更多数据</div>
      <slot></slot>
    </div>
  </div>
</template>

<script>
import { number } from 'echarts';

export default {
  data() {
    return {
      // color: ["#0a5c91", "#082b5a"],
      // color: ['#139DEC', '#0a5c91'],
      color: ['rgba(10, 92, 145, 0.1)', '#73e1ff'],
      backgroundColor: 'rgba(7, 28, 69, 0.6)',
    };
  },
  props: {
    title: {
      type: String,
      default: () => '',
    },
    reverse: {
      type: Boolean,
      default: () => false,
    },
    titleName: {
      type: String,
      default: 'title0',
    },
    listid: {
      type: Number,
      default: 100,
    }
  },
  created() { },

  mounted() { },
  methods: {
    clickTitle() {
      this.$emit('click');
    },
  },
};
</script>
<style lang="scss" scoped>
$item-title-height: 68px;
$item_title_content-height: calc(100% - 68px);

.lr_titles {
  box-sizing: border-box;
  margin: 0 10px;
  pointer-events: auto;
  padding-top: 75px;

  :deep(.border-box-content) {
    box-sizing: border-box;
    padding: 6px 16px 0px;
  }

  .item-title {
    height: $item-title-height + 4px;
    line-height: $item-title-height;
    width: 100%;
    color: #31abe3;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;

    .zuo,
    .you {
      width: 100%;
      height: 9px;
      background: url('../../assets/img/launch/avator/box_title.png') no-repeat center;
      background-position: center center;
      background-size: 62px 9px;
    }

    .title-inner {

      font-family: PangMenZhengDao;
      font-size: 34px;
      // font-size: 28px;
      // font-weight: 600;
      letter-spacing: 2px;
      color: #fff;
      margin-bottom: -4px;
      width: 100%;
      text-align: center;
    }
  }



  .item_title_content {
    height: $item_title_content-height;
  }

  .item_title_content_def {
    width: 100%;
    height: 100%;
  }

  .more {
    position: absolute;
    // right: 40px;
    bottom: 20px;
    font-size: 14px;
    cursor: pointer;
    animation: scaleAnimation 1.5s ease-in-out infinite;

    &:hover {
      animation-play-state: paused;
    }

    &::after {
      position: absolute;
      top: -4px;
      content: url('../../assets/img/launch/avator/more.png');
    }

    //   transform: rotate(-20deg); // 设置旋转角度为90度
    //   transform-origin: center center; // 设置旋转中心为元素中心
    //   transition: all 0.5s;
  }
}

.l-item {
  padding-top: 67px;

  .item-title {
    margin-right: 58px;

    .zuo,
    .you {
      width: calc(100% - 58px);
      height: 9px;
      background: url('../../assets/img/launch/avator/box_title.png') no-repeat center;
      background-position: center right;
      background-size: 62px 9px;
    }

    .title-inner {
      width: calc(100% - 58px);
      text-align: end;

    }

  }

  .more {
    position: absolute;
    left: 640px;
    bottom: 117px;
    font-size: 14px;
    cursor: pointer;
    animation: scaleAnimation 1.5s ease-in-out infinite;

    &:hover {
      animation-play-state: paused;
    }

    &::after {
      position: absolute;
      top: -4px;
      content: url('../../assets/img/launch/avator/more.png');
    }

    //   transform: rotate(-20deg); // 设置旋转角度为90度
    //   transform-origin: center center; // 设置旋转中心为元素中心
    //   transition: all 0.5s;
  }
}

.r-item {
  padding-top: 67px;

  .item-title {
    margin-left: 58px;

    .zuo,
    .you {
      width: calc(100% - 58px);
      height: 9px;
      background: url('../../assets/img/launch/avator/box_title.png') no-repeat center;
      background-position: center left;
      background-size: 62px 9px;
    }

    .title-inner {
      width: calc(100% - 58px);
      text-align: start;
    }

  }

  .more {
    position: absolute;
    right: 420px;
    bottom: 117px;
    font-size: 14px;
    cursor: pointer;
    z-index: 99;
    animation: scaleAnimation 1.5s ease-in-out infinite;

    &:hover {
      animation-play-state: paused;
    }

    &::after {
      position: absolute;
      top: -4px;
      content: url('../../assets/img/launch/avator/more.png');
    }

    //   transform: rotate(-20deg); // 设置旋转角度为90度
    //   transform-origin: center center; // 设置旋转中心为元素中心
    //   transition: all 0.5s;
  }
}

.content_left-item {

  .more {
    position: absolute;
    // right: 40px;
    bottom: 118px;
    left: 1460px;
    font-size: 14px;
    cursor: pointer;
    animation: scaleAnimation 1.5s ease-in-out infinite;

    &:hover {
      animation-play-state: paused;
    }

    &::after {
      position: absolute;
      top: -4px;
      content: url('../../assets/img/launch/avator/more.png');
    }

    //   transform: rotate(-20deg); // 设置旋转角度为90度
    //   transform-origin: center center; // 设置旋转中心为元素中心
    //   transition: all 0.5s;
  }
}

.content_center-item {
  .more {
    display: none;
  }
}

.content_right-item {
  .more {
    position: absolute;
    // right: 40px;
    bottom: 118px;
    left: 3610px;
    font-size: 14px;
    cursor: pointer;
    animation: scaleAnimation 1.5s ease-in-out infinite;

    &:hover {
      animation-play-state: paused;
    }

    &::after {
      position: absolute;
      top: -4px;
      content: url('../../assets/img/launch/avator/more.png');
    }

    //   transform: rotate(-20deg); // 设置旋转角度为90度
    //   transform-origin: center center; // 设置旋转中心为元素中心
    //   transition: all 0.5s;
  }
}

// 定义缩放动画
@keyframes scaleAnimation {
  0% {
    // transform: scale(1);
    // transform: rotate(0deg); // 设置旋转角度为90度
  }

  50% {
    // transform: scale(1.02);
    color: #fff;
    // transform: rotate(-5deg); // 设置旋转角度为90度
  }

  100% {
    // transform: scale(1);
    // transform: rotate(0deg); // 设置旋转角度为90度
  }
}
</style>
